package com.tsingtao.springboot2.mapper;

import com.tsingtao.springboot2.dto.Company;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * The interface Company mapper.
 */
@Mapper
public interface CompanyMapper {

    /**
     * 查询全部
     *
     * @return the list
     */
    List<Company> selectAll();

    /**
     *通过编码查询
     *
     * @param code the code
     * @return the list
     */
    List<Company> selectByCode(String code);

    List<Company> selectByChoose(Company company);

    List<Company> selectByCodeOrName(@Param("code") String codeCode, @Param("name") String name);

    /**
     * 新建
     *
     * @param company the company
     * @return the int
     */
    int insert(Company company);

    int batchInsertByForeach(List<Company> list);

    /**
     * 根据ID更新
     *
     * @param company the company
     * @return the int
     */
    int update(Company company);

    /**
     * 根据ID删除
     *
     * @param id the id
     * @return the int
     */
    int deleteById(Long id);

    int batchDeleteByIds(List<Company> list);

}
